import java.util.ArrayList;
import java.util.List;

/**
 * Created by 84995 on 2020/1/16.
 */
public class test13 {

    public static void main(String[] args) {

        Employee e1=new Employee("小明",1800);
        Employee e2=new Employee("小新",2600);
        List<Employee> list=new ArrayList<>();
        list.add(e1);
        list.add(e2);

        for (Employee emp : list) {
            if ("小明".equals(emp.getName())){
                emp.setSalary(300);
            }
            System.out.println("姓名"+emp.getName()+"---工资："+emp.getSalary());
        }


    }
}
